www.gusucode.com > VC++ 可自定义窗体模式(可以精简显示、隐藏菜单栏等)-源 > VC++ 可自定义窗体模式(可以精简显示、隐藏菜单栏等)-源码程序/code/ViewModeSDIView.cpp
// ViewModeSDIView.cpp : implementation of the CViewModeSDIView class // Download by http://www.NewXing.com #include "stdafx.h" #include "ViewModeSDI.h" #include "ViewModeSDIDoc.h" #include "ViewModeSDIView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CViewModeSDIView IMPLEMENT_DYNCREATE(CViewModeSDIView, CView) BEGIN_MESSAGE_MAP(CViewModeSDIView, CView) //{{AFX_MSG_MAP(CViewModeSDIView) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CViewModeSDIView construction/destruction CViewModeSDIView::CViewModeSDIView() { // TODO: add construction code here } CViewModeSDIView::~CViewModeSDIView() { } BOOL CViewModeSDIView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CViewModeSDIView drawing void CViewModeSDIView::OnDraw(CDC* pDC) { CViewModeSDIDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } ///////////////////////////////////////////////////////////////////////////// // CViewModeSDIView printing BOOL CViewModeSDIView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CViewModeSDIView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CViewModeSDIView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CViewModeSDIView diagnostics #ifdef _DEBUG void CViewModeSDIView::AssertValid() const { CView::AssertValid(); } void CViewModeSDIView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CViewModeSDIDoc* CViewModeSDIView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CViewModeSDIDoc))); return (CViewModeSDIDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CViewModeSDIView message handlers